<template>
  <div class="person">
    <h1 ref='title'>尚硅谷</h1>
    <button @click="me">点我</button>
  </div>
</template>

<script lang="ts" setup name="Person">
import { ref, defineExpose } from 'vue'

let title = ref()

function me() {
  console.log(title.value)
}

defineExpose({ title })

</script>
<style scoped>
.person {
  background-color: skyblue;
  box-shadow: 0 0 10px;
  border-radius: 10px;
  padding: 20px;
}

button {
  margin: 0 5px;
}
</style>